package com.sskj.lib.bean;

import android.arch.persistence.room.Entity;
import android.arch.persistence.room.PrimaryKey;

import com.sskj.lib.util.AESUtils;
import com.sskj.lib.util.EncodeUtils;
import com.sskj.lib.util.EncryptUtil;

import javax.annotation.Nullable;

@Entity()
public class WalletBean {
    @Nullable
    @PrimaryKey(autoGenerate = false)
    private Integer id;
    private String addr;
    private String pri;
    //    private String words = "harsh near glimpse ritual comic ensure tunnel you tonight walnut warfare skull";
    private String words;
    private String keystore;
    private String code;
    private String name;
    private String pwd;
    private boolean isBackup = false;


    public WalletBean(String addr, String pri, String code, int id, String name, String pwd) {
        this.addr = addr;
//        this.pri = EncodeUtils.encodeAES(pri);
        this.pri = pri;
        this.code = code;
        this.id = id;
        this.name = name;
        this.pwd = pwd;
    }

    public boolean isBackup() {
        return isBackup;
    }

    public void setBackup(boolean backup) {
        isBackup = backup;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getWords() {
        return words;
    }

    public void setWords(String words) {
        this.words = words;
    }

    public String getKeystore() {
        return keystore;
    }

    public void setKeystore(String keystore) {
        this.keystore = keystore;
    }

    @Nullable
    public Integer getId() {
        return id;
    }

    public void setId(@Nullable Integer id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getAddr() {
        return addr;
    }

    public void setAddr(String addr) {
        this.addr = addr;
    }

    public String getPri() {
        return pri;
    }
    public String getPriDe() {
        return EncodeUtils.decryptAES(pri);
    }

    public void setPri(String pri) {
        this.pri = pri;
    }
}


